import Vue from 'vue';
import Router from 'vue-router';
import login from '@/components/views/login/login';
import VueResource from 'vue-resource';

//首页
const home = resoleve => require(['../components/views/home/home.vue'],resoleve);

//文章管理页
const articles = resoleve => require(['../components/views/articles/articles.vue'],resoleve);

//图片管理页
const images = resoleve => require(['../components/views/images/images.vue'],resoleve);

//404页面
const noPage = resoleve => require(['../components/views/404/page404.vue'],resoleve);

Vue.use(Router);
Vue.use(VueResource);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/home',
      name: 'home',
      component: home
    },
    {
      path: '/articles',
      name: 'articles',
      component: articles
    },
    {
      path: '/images',
      name: 'images',
      component: images
    },
    {
      path: '/**',
      name: 'noPage',
      component: noPage
    }
  ]
});
